package com.yu.thread5;

/**
 * Created by xiaolongyu on 15/3/19.
 */
public class PairManipulator implements Runnable {

    private PairManager pm;

    public PairManipulator(PairManager pm){
        this.pm = pm;
    }

    @Override
    public void run() {
        while(true){
            pm.increment();
            Thread.yield();
        }
    }

    public String toString(){
        return "Pair:" + pm + " checkCounter = " + pm.checkCounter.get();
    }
}
